﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK;
using OpenTK.Graphics.OpenGL;

namespace Imagiality.MeshProcessing
{
    public class Point3D : NodeSceneObject, Renderable, Selectable
    {
        private float x, y, z;

        private bool isSelected;
        private bool isMarked;
        
        public Point3D(SceneObject parent, float x, float y, float z) : base(parent)
        {
            this.x = x;
            this.y = y;
            this.z = z;
        }

        public float X
        {
            get { return x; }
        }

        public float Y
        {
            get { return y; }
        }

        public float Z
        {
            get { return z;  }
        
        }

        public override IList<NodeSceneObject> GetChilds()
        {
            return new List<NodeSceneObject>();
        }

        public void Display()
        {
            GL.PushName(GetID());

            GL.Begin(BeginMode.Points);
            GL.Vertex3(x, y, z);
            GL.End();
            GL.PopName();
        }

        public bool IsSelected
        {
            get
            {
                return isSelected;
            }
            set
            {
                isSelected = value;
            }
        }

        public bool IsMarked
        {
            get
            {
                return isMarked;
            }
            set
            {
                isMarked = value;
            }
        }

        public void Perform(SelectionOperation operation)
        {
            throw new NotImplementedException();
        }


    }
}
